using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class PrescdetailMap : EntityTypeConfiguration<Prescdetail>
    {
        public PrescdetailMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.Drug_Name)
                .IsRequired()
                .HasMaxLength(100);

            this.Property(t => t.Dose)
                .HasMaxLength(20);

            this.Property(t => t.Form)
                .HasMaxLength(20);

            this.Property(t => t.usage)
                .HasMaxLength(100);

            this.Property(t => t.code)
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("Prescdetails");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Pres_id).HasColumnName("Pres_id");
            this.Property(t => t.Drug_Name).HasColumnName("Drug_Name");
            this.Property(t => t.Dose).HasColumnName("Dose");
            this.Property(t => t.Form).HasColumnName("Form");
            this.Property(t => t.usage).HasColumnName("usage");
            this.Property(t => t.code).HasColumnName("code");
        }
    }
}
